home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / dl.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  2.2 KB  |  90 lines

  1. /* */
  2.  
  3. call rxmuiopt("DEBUGMODE SHOWERR")
  4.  
  5. listview.list="DIRL"
  6. dirl.class="dirlist"
  7. dirl.directory=programname("PATH")
  8. dirl.test="1"x
  9. dirl.format=""
  10. listview.weight=1000
  11. listview.frame="READLIST"
  12. res=NewObj("LISTVIEW","LISTVIEW")
  13. if res~=0 then call err(res)
  14.  
  15. app.Title="DirList"
  16. app.Version="$VER: DirList 1.0 (22.11.99)"
  17. app.Copyright="©1999, alfie"
  18. app.Author="alfie"
  19. app.Description="DirList"
  20. app.Base="EXAMPLE"
  21. app.SubWindow="WIN"
  22.  win.Title="Dirlist"
  23.  win.Contents="MGROUP"
  24.   mgroup.0="LISTVIEW"
  25.   mgroup.1=String("DIR",,Programname("PATH"))
  26.   mgroup.4=hvspace()
  27.  
  28. res=NewObj("APPLICATION","APP")
  29. if res~=0 then call err(res)
  30.  
  31. res=Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  32. if res~=0 then call err(res)
  33.  
  34. res=Notify("DIR","NEWCONTENTS","EVERYTIME","dirl","SET","directory","TRIGGERVALUE")
  35. res=Notify("LISTVIEW","DOUBLECLICK","EVERYTIME","APP","RETURNID")
  36. /*res=Notify("dirl","DIRECTORY","EVERYTIME","APP","RETURNID")*/
  37.  
  38. if res~=0 then call err(res)
  39.  
  40. res=set("WIN","OPEN",1)
  41. if res~=0 then call err(res)
  42.  
  43. s=0
  44. do forever
  45.     call handle("APP","H",s)
  46.     do i=0 to h.num-1
  47.         if h.i="QUIT" then exit
  48.         if h.i="dirl" then do
  49.             call getattr("DIRL","DIRECTORY","D")
  50.             call pragma("D",d)
  51. say d
  52.         end
  53.         if h.i="LISTVIEW" then do
  54.             res=DoMethod("dirl","GETENTRY","ACTIVE","A")
  55.             if res~=0 then call err(res)
  56.             say a.name a.entrytype pragma("D")
  57.             if a.entrytype>0 then do
  58.                 call pragma("D",a.name)
  59.                 call set("dirl","DIRECTORY",pragma("D"))
  60.                 call set("DIR","CONTENTS",pragma("D"))
  61.             end
  62.         end
  63.     end
  64.     s=Wait(or(h.signals,2**12))
  65.     if and(s,2**12)~=0 then exit
  66. end
  67. exit
  68.  
  69. err: procedure expose sigl
  70. parse arg res
  71.     say getrxmuistring(res) "in line" sigl-1
  72.     exit
  73.  
  74. makeToggle: procedure
  75. parse arg name,text,state,cc
  76.     return ToggleButton(name,text,state)
  77.     b.Contents=text
  78.     b.inputmode="TOGGLE"
  79.     b.showselstate=1
  80.     b.selected=state
  81.     b.font="BUTTON"
  82.     b.frame="BUTTON"
  83.     b.background="BUTTONBACK"
  84.     b.TextHiChar=cc
  85.     b.ControlChar=cc
  86.     b.TextHiCharIdx='_'
  87.     res=newobj("TEXT",name,"B")
  88.     if res then call esci(res)
  89.     return name
  90.